.class public Lcom/opongo/blogapp/activities/AppPreferenceActivity;
.super Landroid/preference/PreferenceActivity;
.source "AppPreferenceActivity.java"


# static fields
#the value of this static final field might be set in the static constructor
.field public static final DEBUG:Z = false

.field public static final PREFS_NAME:Ljava/lang/String; = "BlogApp"

.field private static final TAG:Ljava/lang/String;

.field static final TIME_DIALOG_ID:I


# instance fields
.field private apiManager:Lcom/opongo/blogapp/manager/APIManager;

.field private mHour:I

.field private mMinute:I

.field private mTimeSetListener:Landroid/app/TimePickerDialog$OnTimeSetListener;

.field private nighttimeCurrent:Landroid/preference/Preference;

.field private nighttimeFrom:Landroid/preference/Preference;

.field nighttimeFromString:Ljava/lang/String;

.field private nighttimeTo:Landroid/preference/Preference;

.field nighttimeToString:Ljava/lang/String;

.field private pushNighttimeTBtn:Landroid/preference/CheckBoxPreference;

.field private pushSoundTBtn:Landroid/preference/CheckBoxPreference;

.field private pushTBtn:Landroid/preference/CheckBoxPreference;

.field private settings:Landroid/content/SharedPreferences;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 33
    const-class v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->TAG:Ljava/lang/String;

    .line 34
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->DEBUG:Z

    .line 31
    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 31
    invoke-direct {p0}, Landroid/preference/PreferenceActivity;-><init>()V

    .line 52
    const-string v0, "22:00"

    iput-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    .line 53
    const-string v0, "08:00"

    iput-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    .line 417
    new-instance v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$1;

    invoke-direct {v0, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$1;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    iput-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mTimeSetListener:Landroid/app/TimePickerDialog$OnTimeSetListener;

    .line 31
    return-void
.end method

.method static synthetic access$0(Lcom/opongo/blogapp/activities/AppPreferenceActivity;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 47
    iput p1, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mHour:I

    return-void
.end method

.method static synthetic access$1(Lcom/opongo/blogapp/activities/AppPreferenceActivity;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 48
    iput p1, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mMinute:I

    return-void
.end method

.method static synthetic access$2(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 388
    invoke-direct {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->updateDisplay()V

    return-void
.end method

.method static synthetic access$3()Ljava/lang/String;
    .locals 1

    .prologue
    .line 33
    sget-object v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$4(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)Landroid/preference/Preference;
    .locals 1
    .parameter

    .prologue
    .line 43
    iget-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFrom:Landroid/preference/Preference;

    return-object v0
.end method

.method static synthetic access$5(Lcom/opongo/blogapp/activities/AppPreferenceActivity;Landroid/preference/Preference;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 45
    iput-object p1, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeCurrent:Landroid/preference/Preference;

    return-void
.end method

.method static synthetic access$6(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)Landroid/preference/Preference;
    .locals 1
    .parameter

    .prologue
    .line 44
    iget-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeTo:Landroid/preference/Preference;

    return-object v0
.end method

.method static synthetic access$7(Lcom/opongo/blogapp/activities/AppPreferenceActivity;Landroid/content/SharedPreferences;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 37
    iput-object p1, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    return-void
.end method

.method static synthetic access$8(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)Landroid/content/SharedPreferences;
    .locals 1
    .parameter

    .prologue
    .line 37
    iget-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    return-object v0
.end method

.method private static pad(I)Ljava/lang/String;
    .locals 2
    .parameter "c"

    .prologue
    .line 410
    const/16 v0, 0xa

    if-lt p0, v0, :cond_0

    .line 411
    invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    .line 413
    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "0"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method private updateDisplay()V
    .locals 5

    .prologue
    .line 390
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getBaseContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 392
    .local v1, prefs:Landroid/content/SharedPreferences;
    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 394
    .local v0, editor:Landroid/content/SharedPreferences$Editor;
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeCurrent:Landroid/preference/Preference;

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFrom:Landroid/preference/Preference;

    if-ne v2, v3, :cond_0

    .line 395
    new-instance v2, Ljava/lang/StringBuilder;

    iget v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mHour:I

    invoke-static {v3}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pad(I)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mMinute:I

    invoke-static {v3}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pad(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    .line 396
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFrom:Landroid/preference/Preference;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "von "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " Uhr"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/preference/Preference;->setTitle(Ljava/lang/CharSequence;)V

    .line 397
    const-string v2, "nighttimeFromPrefs"

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 404
    :goto_0
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 406
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->onClickSavePush(Landroid/preference/Preference;)V

    .line 407
    return-void

    .line 399
    :cond_0
    new-instance v2, Ljava/lang/StringBuilder;

    iget v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mHour:I

    invoke-static {v3}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pad(I)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mMinute:I

    invoke-static {v3}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pad(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    .line 400
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeTo:Landroid/preference/Preference;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "bis "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " Uhr"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/preference/Preference;->setTitle(Ljava/lang/CharSequence;)V

    .line 401
    const-string v2, "nighttimeToPrefs"

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    goto :goto_0
.end method


# virtual methods
.method public onBackPressed()V
    .locals 0

    .prologue
    .line 446
    invoke-super {p0}, Landroid/preference/PreferenceActivity;->onBackPressed()V

    .line 447
    return-void
.end method

.method public onClickSavePush(Landroid/preference/Preference;)V
    .locals 5
    .parameter "preference"

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 363
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushTBtn:Landroid/preference/CheckBoxPreference;

    if-ne p1, v2, :cond_0

    .line 364
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v2

    if-nez v2, :cond_0

    .line 365
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushSoundTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2, v3}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 366
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushNighttimeTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2, v3}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 370
    :cond_0
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushSoundTBtn:Landroid/preference/CheckBoxPreference;

    if-ne p1, v2, :cond_1

    .line 371
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 374
    :cond_1
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushNighttimeTBtn:Landroid/preference/CheckBoxPreference;

    if-ne p1, v2, :cond_2

    .line 375
    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 379
    :cond_2
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getBaseContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 381
    .local v1, prefs:Landroid/content/SharedPreferences;
    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 383
    .local v0, editor:Landroid/content/SharedPreferences$Editor;
    const-string v2, "nighttimeFromPrefs"

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 384
    const-string v2, "nighttimeToPrefs"

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 385
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 386
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 14
    .parameter "savedInstanceState"

    .prologue
    const/4 v13, 0x0

    .line 57
    invoke-super {p0, p1}, Landroid/preference/PreferenceActivity;->onCreate(Landroid/os/Bundle;)V

    .line 58
    const/high16 v10, 0x7f04

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->addPreferencesFromResource(I)V

    .line 60
    new-instance v10, Lcom/opongo/blogapp/manager/APIManager;

    invoke-direct {v10, p0}, Lcom/opongo/blogapp/manager/APIManager;-><init>(Landroid/content/Context;)V

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->apiManager:Lcom/opongo/blogapp/manager/APIManager;

    .line 62
    const-string v10, "BlogApp"

    invoke-virtual {p0, v10, v13}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v10

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    .line 64
    const-string v10, "toggleButtonPush"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/CheckBoxPreference;

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushTBtn:Landroid/preference/CheckBoxPreference;

    .line 65
    const-string v10, "toggleButtonPushSound"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/CheckBoxPreference;

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushSoundTBtn:Landroid/preference/CheckBoxPreference;

    .line 66
    const-string v10, "toggleButtonNighttime"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/CheckBoxPreference;

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushNighttimeTBtn:Landroid/preference/CheckBoxPreference;

    .line 68
    const-string v10, "nighttimeFrom"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFrom:Landroid/preference/Preference;

    .line 69
    const-string v10, "nighttimeTo"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeTo:Landroid/preference/Preference;

    .line 71
    const-string v10, "PushPrefScreen"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v6

    .line 73
    .local v6, pushPrefScreen:Landroid/preference/Preference;
    sget v10, Landroid/os/Build$VERSION;->SDK_INT:I

    const/4 v11, 0x7

    if-gt v10, v11, :cond_0

    .line 74
    invoke-virtual {v6, v13}, Landroid/preference/Preference;->setEnabled(Z)V

    .line 78
    :cond_0
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getBaseContext()Landroid/content/Context;

    move-result-object v10

    invoke-static {v10}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 80
    .local v4, prefs:Landroid/content/SharedPreferences;
    const-string v10, "nighttimeFromPrefs"

    const-string v11, "22:00"

    invoke-interface {v4, v10, v11}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    .line 81
    const-string v10, "nighttimeToPrefs"

    const-string v11, "08:00"

    invoke-interface {v4, v10, v11}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    .line 82
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFrom:Landroid/preference/Preference;

    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "von "

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v12, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, " Uhr"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Landroid/preference/Preference;->setTitle(Ljava/lang/CharSequence;)V

    .line 83
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeTo:Landroid/preference/Preference;

    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "bis "

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v12, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, " Uhr"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Landroid/preference/Preference;->setTitle(Ljava/lang/CharSequence;)V

    .line 86
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFrom:Landroid/preference/Preference;

    new-instance v11, Lcom/opongo/blogapp/activities/AppPreferenceActivity$2;

    invoke-direct {v11, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$2;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v10, v11}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 114
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeTo:Landroid/preference/Preference;

    new-instance v11, Lcom/opongo/blogapp/activities/AppPreferenceActivity$3;

    invoke-direct {v11, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$3;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v10, v11}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 142
    const-string v10, "impressumBtn"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v3

    .line 143
    .local v3, impressumBtn:Landroid/preference/Preference;
    new-instance v10, Lcom/opongo/blogapp/activities/AppPreferenceActivity$4;

    invoke-direct {v10, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$4;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v3, v10}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 167
    const-string v10, "aboutUsBtn"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    .line 168
    .local v0, aboutUsBtn:Landroid/preference/Preference;
    new-instance v10, Lcom/opongo/blogapp/activities/AppPreferenceActivity$5;

    invoke-direct {v10, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$5;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v0, v10}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 192
    const-string v10, "recommendUsBtn"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v9

    .line 193
    .local v9, recommendUsBtn:Landroid/preference/Preference;
    new-instance v10, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;

    invoke-direct {v10, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v9, v10}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 229
    const-string v10, "contactUsBtn"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    .line 230
    .local v1, contactUsBtn:Landroid/preference/Preference;
    new-instance v10, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;

    invoke-direct {v10, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v1, v10}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 275
    const-string v10, "pushCatBtn"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v5

    .line 276
    .local v5, pushCatBtn:Landroid/preference/Preference;
    new-instance v10, Lcom/opongo/blogapp/activities/AppPreferenceActivity$8;

    invoke-direct {v10, p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity$8;-><init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V

    invoke-virtual {v5, v10}, Landroid/preference/Preference;->setOnPreferenceClickListener(Landroid/preference/Preference$OnPreferenceClickListener;)V

    .line 289
    const-string v10, "pushidpref"

    invoke-virtual {p0, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v8

    .line 290
    .local v8, pushidpref:Landroid/preference/Preference;
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    .line 291
    .local v2, context:Landroid/content/Context;
    const-string v10, "BlogApp"

    invoke-virtual {v2, v10, v13}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v10

    iput-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    .line 293
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    const-string v11, "user_id"

    invoke-interface {v10, v11, v13}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v7

    .line 294
    .local v7, push_id:I
    new-instance v10, Ljava/lang/StringBuilder;

    const-string v11, "Push-ID: "

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v10, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v8, v10}, Landroid/preference/Preference;->setTitle(Ljava/lang/CharSequence;)V

    .line 295
    return-void
.end method

.method protected onCreateDialog(I)Landroid/app/Dialog;
    .locals 6
    .parameter "id"

    .prologue
    .line 429
    packed-switch p1, :pswitch_data_0

    .line 435
    const/4 v0, 0x0

    :goto_0
    return-object v0

    .line 431
    :pswitch_0
    new-instance v0, Landroid/app/TimePickerDialog;

    iget-object v2, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mTimeSetListener:Landroid/app/TimePickerDialog$OnTimeSetListener;

    .line 432
    iget v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mHour:I

    iget v4, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->mMinute:I

    const/4 v5, 0x1

    move-object v1, p0

    .line 431
    invoke-direct/range {v0 .. v5}, Landroid/app/TimePickerDialog;-><init>(Landroid/content/Context;Landroid/app/TimePickerDialog$OnTimeSetListener;IIZ)V

    .line 433
    .local v0, t:Landroid/app/TimePickerDialog;
    goto :goto_0

    .line 429
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method

.method protected onDestroy()V
    .locals 0

    .prologue
    .line 440
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->saveNightTimeOnServer()V

    .line 441
    invoke-super {p0}, Landroid/preference/PreferenceActivity;->onDestroy()V

    .line 442
    return-void
.end method

.method public onclickShowText(Ljava/lang/String;)V
    .locals 11
    .parameter "message"

    .prologue
    .line 299
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 300
    .local v0, context:Landroid/content/Context;
    const-string v8, "BlogApp"

    const/4 v9, 0x0

    invoke-virtual {v0, v8, v9}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v8

    iput-object v8, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    .line 302
    iget-object v8, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;

    const-string v9, "blog_details"

    const-string v10, "Error"

    invoke-interface {v8, v9, v10}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 303
    .local v1, detailString:Ljava/lang/String;
    const-string v3, ""

    .line 306
    .local v3, detail_html:Ljava/lang/String;
    :try_start_0
    new-instance v7, Lorg/json/JSONObject;

    invoke-direct {v7, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 308
    .local v7, json:Lorg/json/JSONObject;
    new-instance v4, Ljava/lang/String;

    const-string v8, "detail_html"

    invoke-virtual {v7, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v4, v8}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 310
    .end local v3           #detail_html:Ljava/lang/String;
    .local v4, detail_html:Ljava/lang/String;
    :try_start_1
    const-string v8, ""

    invoke-virtual {v4, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_0

    .line 311
    const-string v3, "Es ist beim Laden ein Fehler aufgetreten. Bitte versuchen Sie es zum sp\u00d4\u00f8\u03a9teren Zeitpunkt noch einmal."
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1

    .line 314
    .end local v4           #detail_html:Ljava/lang/String;
    .restart local v3       #detail_html:Ljava/lang/String;
    :goto_0
    :try_start_2
    const-string v8, "detail_css"

    invoke-virtual {v7, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 316
    .local v2, detail_css:Ljava/lang/String;
    const-string v8, "#post_css#"

    invoke-virtual {v3, v8, v2}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 317
    const-string v8, "#post_content#"

    invoke-virtual {v3, v8, p1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_0

    move-result-object v3

    .line 323
    .end local v2           #detail_css:Ljava/lang/String;
    .end local v7           #json:Lorg/json/JSONObject;
    :goto_1
    new-instance v6, Landroid/content/Intent;

    const-class v8, Lcom/opongo/blogapp/activities/WebViewActivity;

    invoke-direct {v6, p0, v8}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 324
    .local v6, intent:Landroid/content/Intent;
    const-string v8, "message"

    invoke-virtual {v6, v8, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 325
    invoke-virtual {p0, v6}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->startActivity(Landroid/content/Intent;)V

    .line 326
    return-void

    .line 318
    .end local v6           #intent:Landroid/content/Intent;
    :catch_0
    move-exception v5

    .line 320
    .local v5, e:Lorg/json/JSONException;
    :goto_2
    invoke-virtual {v5}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_1

    .line 318
    .end local v3           #detail_html:Ljava/lang/String;
    .end local v5           #e:Lorg/json/JSONException;
    .restart local v4       #detail_html:Ljava/lang/String;
    .restart local v7       #json:Lorg/json/JSONObject;
    :catch_1
    move-exception v5

    move-object v3, v4

    .end local v4           #detail_html:Ljava/lang/String;
    .restart local v3       #detail_html:Ljava/lang/String;
    goto :goto_2

    .end local v3           #detail_html:Ljava/lang/String;
    .restart local v4       #detail_html:Ljava/lang/String;
    :cond_0
    move-object v3, v4

    .end local v4           #detail_html:Ljava/lang/String;
    .restart local v3       #detail_html:Ljava/lang/String;
    goto :goto_0
.end method

.method public saveNightTimeOnServer()V
    .locals 9

    .prologue
    .line 329
    sget-boolean v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->DEBUG:Z

    if-eqz v0, :cond_0

    .line 330
    sget-object v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->TAG:Ljava/lang/String;

    const-string v3, "saveNightTimeOnServer"

    invoke-static {v0, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 334
    :cond_0
    :try_start_0
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getBaseContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v7

    .line 336
    .local v7, prefs:Landroid/content/SharedPreferences;
    const-string v0, "pushRingtone"

    .line 337
    const-string v3, "default"

    .line 336
    invoke-interface {v7, v0, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 339
    .local v4, sound:Ljava/lang/String;
    const-string v0, "spicyDealsTemp"

    .line 340
    const-string v3, "2"

    .line 339
    invoke-interface {v7, v0, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v5

    .line 342
    .local v5, spicyDealsTemp:I
    sget-boolean v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->DEBUG:Z

    if-eqz v0, :cond_1

    sget-object v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->TAG:Ljava/lang/String;

    invoke-static {v0, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 344
    :cond_1
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeFromString:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v0, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":00"

    invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 345
    .local v1, ntFrom:Ljava/lang/String;
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->nighttimeToString:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v0, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":00"

    invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 347
    .local v2, ntTo:Ljava/lang/String;
    iget-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushNighttimeTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    if-nez v0, :cond_2

    .line 348
    const-string v1, "NULL"

    .line 349
    const-string v2, "NULL"

    .line 352
    :cond_2
    iget-object v0, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->apiManager:Lcom/opongo/blogapp/manager/APIManager;

    .line 353
    iget-object v3, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->pushTBtn:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v3}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v3

    .line 352
    invoke-virtual/range {v0 .. v5}, Lcom/opongo/blogapp/manager/APIManager;->setNighttime(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v8

    .line 354
    .local v8, result:Lorg/json/JSONObject;
    sget-boolean v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->DEBUG:Z

    if-eqz v0, :cond_3

    .line 355
    sget-object v0, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->TAG:Ljava/lang/String;

    invoke-virtual {v8}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v0, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 360
    .end local v1           #ntFrom:Ljava/lang/String;
    .end local v2           #ntTo:Ljava/lang/String;
    .end local v4           #sound:Ljava/lang/String;
    .end local v5           #spicyDealsTemp:I
    .end local v7           #prefs:Landroid/content/SharedPreferences;
    .end local v8           #result:Lorg/json/JSONObject;
    :cond_3
    :goto_0
    return-void

    .line 356
    :catch_0
    move-exception v6

    .line 358
    .local v6, e:Lorg/json/JSONException;
    invoke-virtual {v6}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0
.end method
